<div class="text-danger selected-info" style="padding-bottom: 10px;">请选择需要关联的投标信息</div>

<ul class="nav nav-tabs" role="tablist">
	<li role="presentation" class="active">
		<a href="#not-sign" role="tab" data-toggle="tab">中标待签</a>
	</li>
	<li role="presentation">
		<a href="#signed" role="tab" data-toggle="tab">附加新合同</a>
	</li>
</ul>

<div class="tab-content bids-for-sign-contract">
	<div role="tabpanel" class="tab-pane active" id="not-sign" style="min-height: 100px;">
		<div class="text-danger" style="border: 1px solid #ddd; border-top: none; padding: 10px;">数据加载中……</div>
	</div>
	<div role="tabpanel" class="tab-pane" id="signed" style="min-height: 100px;">
		<div class="text-danger" style="border: 1px solid #ddd; border-top: none; padding: 10px;">数据加载中……</div>
	</div>
</div>

<script type="text/javascript">
	var notSignPage = function(page, pageSize) {
		$.get(ctxp + '/front-page/get-bid-for-link-contract-not-sign', {
			page : page,
			pageSize : pageSize
		}, function(html, textStatus, jqXHR) {
			if (html) {
				$('#not-sign').html(html);
			}
		}, 'html');
	};
	var signedPage = function(page, pageSize) {
		$.get(ctxp + '/front-page/get-bid-for-link-contract-signed', {
			page : page,
			pageSize : pageSize
		}, function(html, textStatus, jqXHR) {
			if (html) {
				$('#signed').html(html);
			}
		}, 'html');
	};

	$('div.bids-for-sign-contract').on('change', '[name="bid-id"]', function() {
		var $this = $(this);

		if (!$this.prop('checked'))
			return false;

		var info = $('div.selected-info').text('<已选择>：');
		var tr = $this.parent().parent();
		info.text(info.text() + '【' + tr.find('>td.project-no').text() + '】');
		info.text(info.text() + tr.find('>td.name').text());
	});

	notSignPage();
	signedPage();
</script>
